package me.send.data.service.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import me.send.business.base.Pager;
import me.send.data.service.mapper.UserMapper;
import me.send.data.service.pojo.UserBean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
	
	@Autowired
	private UserMapper userMapper;
	
	 // 使用分页查询
    public List<UserBean> list(String phone,
    		Integer status, String start, String end,Integer sex,Pager page) {
    	Map<String, Object> parameter = new HashMap<String, Object>();
    	parameter.put("phone", phone);
    	parameter.put("status", status);
    	parameter.put("sex", sex);
    	parameter.put("start", start);
    	parameter.put("end", end);
    	parameter.put("page", page);
    	List<UserBean> rows = userMapper.list(parameter);
    	return rows;
    }
    // 查询总数
    public Integer count(String phone,
    		Integer status, String start, String end,Integer sex) {
    	Map<String, Object> parameter = new HashMap<String, Object>();
    	parameter.put("phone", phone);
    	parameter.put("status", status);
    	parameter.put("sex", sex);
    	parameter.put("start", start);
    	parameter.put("end", end);
    	Integer rows = userMapper.count(parameter);
    	return rows;
    }
	

}
